<template>
  <div>
    {{ count }}
    <button @click="updateCount">child</button>
  </div>
</template>

<script setup lang="ts">
const count = defineModel("count", {
  type: Number,
  default: 0
}) 

const updateCount = () =>{
  count.value++
}
//=========================接口泛型===

// 定义接口和类
interface Transformer<T, U> {
  transform(input: T): U;
  compare(a: T, b: T): number;
}

class StringTransformer implements Transformer<string, number> {
  transform(input: string): number {
    return input.length;
  }
  
  compare(a: string, b: string): number {
    return a.length - b.length;
  }
}

// 使用示例
const processor = new StringTransformer();
console.log(processor.transform("TypeScript")); // 输出: 10
console.log(processor.compare("A", "AB"));      // 输出: -1


                
          
          
          
let arr:number[] =[1,2,4,68,3]
arr.unshift(11,33)
console.log(arr)


</script>
